﻿#include "ImagaeParametersPanel.h"

#include <QGroupBox>
#include <QLabel>
#include <QSlider>
#include <QLineEdit>
#include <QGridLayout>

ImagaeParametersPanel::ImagaeParametersPanel(QWidget *parent)
	: QGroupBox(parent)
{
	setupUi();
}

ImagaeParametersPanel::~ImagaeParametersPanel()
{}

void ImagaeParametersPanel::initComponents()
{
    auto lbBrightness = new QLabel(tr("亮度:"));
	auto sliderBrightness = new QSlider(Qt::Horizontal);
	auto lineBrightness = new QLineEdit();

    auto lbContrast = new QLabel(tr("对比度:"));
	auto sliderContrast = new QSlider(Qt::Horizontal);
	auto lineContrast = new QLineEdit();

    auto lbGrayLevel = new QLabel(tr("灰度级:"));
	auto sliderGrayLevel = new QSlider(Qt::Horizontal);
	auto lineGrayLevel = new QLineEdit();

	auto layout = new QGridLayout();
	layout->addWidget(lbBrightness, 0, 0,1,1);
	layout->addWidget(sliderBrightness, 0, 1, 1, 1);
	layout->addWidget(lineBrightness, 0, 2, 1, 1);
	layout->addWidget(lbContrast, 1, 0, 1, 1);
	layout->addWidget(sliderContrast, 1, 1, 1, 1);
	layout->addWidget(lineContrast, 1, 2, 1, 1);
	layout->addWidget(lbGrayLevel, 2, 0, 1, 1);
	layout->addWidget(sliderGrayLevel, 2, 1, 1, 1);
	layout->addWidget(lineGrayLevel, 2, 2, 1, 1);
	setLayout(layout);
    setTitle(tr("图像参数设定"));

}

void ImagaeParametersPanel::setupUi()
{
	initComponents();
}

